Sha256: b64ba68c6636854dc574a94f206e1d332c3c460a822c4d70f8408f4163eb2c0c

Contents?: true

Size: 526 Bytes

Versions: 1

Compression:

Stored size: 526 Bytes

Contents

# frozen_string_literal: true

require 'teLogger'
require 'toolrack'


require_relative "ruby/version"

require_relative 'provider'

module Binenc
  module Ruby
    class Error < StandardError; end
    # Your code goes here...
 
    # detect if the given string is binary or not
    def self.is_binary_string?(str)
      # https://stackoverflow.com/a/32536221/3625825
      str.count('01') == str.size
    end


  end
end


# register the provider
require 'binenc'
Binenc::Provider.instance.register(Binenc::Ruby::Provider)


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
binenc-ruby-0.1.0 lib/binenc/ruby.rb