{"record":{"id":"ca4583fbb0440c89","repo":"in3rsha/sha256-animation","slug":"we-only-operate-on-32-bit-words-in-sha-256-your-x-ca4583","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":"usigma0.rb","lineNumber":18,"sourceCode":"# coding: utf-8\nrequire_relative \"sha256lib.rb\"\n\n# -----\n# Σ0(x)\n# -----\n# Σ0(x) = ROTR(2, x) ^ ROTR(13, x) ^ ROTR(22, x)\n\n# -----\n# Input\n# -----\n# default\nx = 0b00000000000000000011111111111111 # 0b11101001101101011101101110100101\n# argument passed\nx = ARGV[0].to_i(2) if ARGV[0] # binary\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# ---------\nsystem \"clear\"\nputs \"x:       #{bits(x)}\"\nputs \"         #{'-'*32}\"\nputs \"ROTR 2:  #{bits(x)}\"\nputs \"ROTR 13: #{bits(x)}\"\nputs \"ROTR 22: #{bits(x)}\"\nputs \"         #{'-'*32}\"\nputs \"Σ0(x):\"\nsleep(0.1)\n\n# ROTR(2, x)\n(2+1).times do |i|\n  system \"clear\"","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/in3rsha/sha256-animation/blob/871e976d69e66474ef5239ee82031b7d87cbcafc/usigma0.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 usigma0.rb:18 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 usigma0.rb 00000000000000000011111111111111`.","Count the bits in your input: ARGV[0].size must be <= 32. SHA-256 words are 32-bit, so trim or split longer inputs."],"exampleFix":"ruby usigma0.rb 00000000000000000011111111111111","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"}