{"record":{"id":"35be5cef77b95c1e","repo":"in3rsha/sha256-animation","slug":"we-only-operate-on-32-bit-words-in-sha-256-your-x-35be5c","errorCode":null,"errorMessage":"We only operate on 32-bit words in SHA-256. Your x is #{ARGV[0].size} bits.","messagePattern":"We only operate on 32-bit words in SHA-256\\. Your x is #(.+?) bits\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"shr.rb","lineNumber":19,"sourceCode":"# -----------\n# Shift Right\n# -----------\ndef shr(n, x)\n  x >> n\nend\n\n# -----\n# Input\n# -----\n# defaults\nx = 0b11111111000000001111111100000000 #0b11101001101101011101101110100101\nn = 32     \n# arguments passed\nx = ARGV[0].to_i(2) if ARGV[0] # binary\nn = ARGV[1].to_i    if ARGV[1] # integer\n# check arguments\nif ARGV[0] && ARGV[0].size > 32\n\tputs \"We only operate on 32-bit words in SHA-256. Your x is #{ARGV[0].size} bits.\"; exit\nend\n\n# ---------\n# Animation\n# ---------\ns = n.to_s.ljust(2, \" \")\nn.times do |i|\n  system \"clear\"\n  i += 1\n\n  puts \"      x: #{\"%032b\" % x}\"\n  puts \" SHR #{s}: #{\"%032b\" % shr(i, x)}\"\n\n  sleep 0.1\nend\nsleep 0.4\n","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/in3rsha/sha256-animation/blob/871e976d69e66474ef5239ee82031b7d87cbcafc/shr.rb#L1-L36","documentation":"Error \"We only operate on 32-bit words in SHA-256. Your x is #{ARGV[0].size} bits.\" thrown in in3rsha/sha256-animation.","triggerScenarios":"Thrown at shr.rb:19 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the first argument as a binary string of 32 bits or fewer, e.g. `ruby shr.rb 11111111000000001111111100000000 4`.","Count the bits in your input: ARGV[0].size must be <= 32. Remove extra digits or split the value into 32-bit words."],"exampleFix":"ruby shr.rb 11111111000000001111111100000000 4","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"871e976d69e66474ef5239ee82031b7d87cbcafc","analyzedAt":"2026-08-23T12:17:23.862Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}