sha265.rb
# Convert input (hex, ascii) to array of bytes
Convert input (hex, ascii) to array of bytes
Convert input ( hex ascii ) to array of bytes
def bytes(input, type)
  case type
    when "hex"
      hex = input[2..-1] 
      bytes = [hex].pack("H*").unpack("C*") 
    else
      bytes = input.bytes 
  end
  return bytes
end
def bytes ( input , type ) case type when "hex" hex = input [ 2 .. - 1 ] bytes = [ hex ] . pack ( "H*" ) . unpack ( "C*" ) else bytes = input . bytes end return bytes end
Convert input (hex, ascii) to array of bytes
Convert input ( hex ascii ) to array of bytes
# Removed unused "binary" type from original # trim 0x prefix # convert hex string to bytes # convert ASCII string to bytes
input
type