{"id":15010947,"url":"https://github.com/leventerkok/cracknum","last_synced_at":"2025-04-09T13:10:16.279Z","repository":{"id":29690359,"uuid":"33232976","full_name":"LeventErkok/crackNum","owner":"LeventErkok","description":"Convert to/from IEEE-754 HP/SP/DP formats","archived":false,"fork":false,"pushed_at":"2024-11-09T17:27:22.000Z","size":144,"stargazers_count":21,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-02T07:54:04.168Z","etag":null,"topics":["floating-point","haskell","ieee754"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LeventErkok.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-04-01T07:26:26.000Z","updated_at":"2025-01-30T23:40:27.000Z","dependencies_parsed_at":"2024-02-19T23:23:49.043Z","dependency_job_id":"68828e4e-8834-4b1e-8ba1-fe6a8f59ad05","html_url":"https://github.com/LeventErkok/crackNum","commit_stats":{"total_commits":96,"total_committers":4,"mean_commits":24.0,"dds":0.03125,"last_synced_commit":"dbec3dbac48ff14089ef48a4150a85f4570e92ad"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeventErkok%2FcrackNum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeventErkok%2FcrackNum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeventErkok%2FcrackNum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeventErkok%2FcrackNum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeventErkok","download_url":"https://codeload.github.com/LeventErkok/crackNum/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045245,"owners_count":21038554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["floating-point","haskell","ieee754"],"created_at":"2024-09-24T19:37:42.622Z","updated_at":"2025-04-09T13:10:16.263Z","avatar_url":"https://github.com/LeventErkok.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Decode/Encode Integers, Words, and IEE754 Floats\n\nOn Hackage: http://hackage.haskell.org/package/crackNum\n\n### Example: Encode a decimal number as a single-precision IEEE754 number\n```\n$ crackNum -fsp -- -2.3e6\nSatisfiable. Model:\n  ENCODED = -2300000.0 :: Float\n                  3  2          1         0\n                  1 09876543 21098765432109876543210\n                  S ---E8--- ----------S23----------\n   Binary layout: 1 10010100 00011000110000110000000\n      Hex layout: CA0C 6180\n       Precision: Single\n            Sign: Negative\n        Exponent: 21 (Stored: 148, Bias: 127)\n  Classification: FP_NORMAL\n          Binary: -0b1.0001100011000011p+21\n           Octal: -0o1.061414p+21\n         Decimal: -2300000.0\n             Hex: -0x2.3186p+20\n   Rounding mode: RNE: Round nearest ties to even.\n            Note: Conversion from \"-2.3e6\" was exact. No rounding happened.\n```\n\n### Example: Decode a single-precision IEEE754 number float from memory-layout\n```\n$ crackNum -fsp  0xfc00 abc1\nSatisfiable. Model:\n  DECODED = -2.6723903e36 :: Float\n                  3  2          1         0\n                  1 09876543 21098765432109876543210\n                  S ---E8--- ----------S23----------\n   Binary layout: 1 11111000 00000001010101111000001\n      Hex layout: FC00 ABC1\n       Precision: Single\n            Sign: Negative\n        Exponent: 121 (Stored: 248, Bias: 127)\n  Classification: FP_NORMAL\n          Binary: -0b1.00000001010101111000001p+121\n           Octal: -0o2.00527404p+120\n         Decimal: -2.6723903e36\n             Hex: -0x2.02AF04p+120\n$ crackNum -fdp 0xfc00 abc1 7F80 0001\n```\n\n### Example: Decode a custom (2+3) IEEE754 float from memory-layout\n```\n$ crackNum -f2+3 0b10011\nSatisfiable. Model:\n  DECODED = -0.75 :: FloatingPoint 2 3\n                  4 32 10\n                  S E2 S2\n   Binary layout: 1 00 11\n      Hex layout: 13\n       Precision: 2 exponent bits, 2 significand bits\n            Sign: Negative\n        Exponent: 0 (Subnormal, with fixed exponent value. Stored: 0, Bias: 1)\n  Classification: FP_SUBNORMAL\n          Binary: -0b1.1p-1\n           Octal: -0o6p-3\n         Decimal: -0.75\n             Hex: -0xcp-4\n```\n\n### Example: Encode an integer as a 7-bit signed word\n```\n$ crackNum -i7 12\nSatisfiable. Model:\n  ENCODED = 12 :: IntN 7\n                  654 3210\n   Binary layout: 000 1100\n      Hex layout: 0C\n            Type: Signed 7-bit 2's complement integer\n            Sign: Positive\n          Binary: 0b1100\n           Octal: 0o14\n         Decimal: 12\n             Hex: 0xc\n```\n\n### Example: Decode two half-precision floats in two lanes\n```\n$ crackNum -l2 -fhp 32\\'hfdc71fc6\n== Lane 1 ============================================================\nSatisfiable. Model:\n  DECODED = NaN :: FloatingPoint 5 11\n                  1       0\n                  5 43210 9876543210\n                  S -E5-- ---S10----\n   Binary layout: 1 11111 0111000111\n      Hex layout: FDC7\n       Precision: Half (5 exponent bits, 10 significand bits.)\n            Sign: Negative\n        Exponent: 16 (Stored: 31, Bias: 15)\n  Classification: FP_NAN (Signaling)\n           Value: NaN\n            Note: Representation for NaN's is not unique\n== Lane 0 ============================================================\nSatisfiable. Model:\n  DECODED = 0.0075912 :: FloatingPoint 5 11\n                  1       0\n                  5 43210 9876543210\n                  S -E5-- ---S10----\n   Binary layout: 0 00111 1111000110\n      Hex layout: 1FC6\n       Precision: Half (5 exponent bits, 10 significand bits.)\n            Sign: Positive\n        Exponent: -8 (Stored: 7, Bias: 15)\n  Classification: FP_NORMAL\n          Binary: 0b1.111100011p-8\n           Octal: 0o3.706p-9\n         Decimal: 0.0075912\n             Hex: 0x1.f18p-8\n```\n\n### Usage info\n```\nUsage: crackNum value OR binary/hex-pattern\n  -i N                 Signed   integer of N-bits\n  -w N                 Unsigned integer of N-bits\n  -f fp                Floating point format fp\n  -r rm                Rounding mode to use. If not given, Nearest-ties-to-Even.\n  -l lanes             Number of lanes to decode\n  -h, -?    --help     print help, with examples\n  -v        --version  print version info\n  -d        --debug    debug mode, developers only\n\nExamples:\n Encoding:\n   crackNum -i4    -- -2                    -- encode as 4-bit signed integer\n   crackNum -w4    2                        -- encode as 4-bit unsigned integer\n   crackNum -f3+4  2.5                      -- encode as float with 3 bits exponent, 4 bits significand\n   crackNum -f3+4  2.5 -rRTZ                -- encode as above, but use RTZ rounding mode.\n   crackNum -fbp   2.5                      -- encode as a brain-precision float\n   crackNum -fdp   2.5                      -- encode as a double-precision float\n   crackNum -fe4m3 2.5                      -- encode as an E4M3 FP8 float\n   crackNum -fe5m2 2.5                      -- encode as an E5M2 FP8 float\n   crackNum -fsp   0x3.2p5                  -- encode as single-precision from hex-float\n\n Decoding:\n   crackNum -i4      0b0110                -- decode as 4-bit signed integer, from binary\n   crackNum -w4      0xE                   -- decode as 4-bit unsigned integer, from hex\n   crackNum -f3+4    0b0111001             -- decode as float with 3 bits exponent, 4 bits significand\n   crackNum -fbp     0x000F                -- decode as a brain-precision float\n   crackNum -fdp     0x8000000000000000    -- decode as a double-precision float\n   crackNum -fhp     0x8000                -- decode as a half-precision float\n   crackNum -l4 -fhp 64\\'hbdffaaffdc71fc60 -- decode as half-precision float over 4 lanes using verilog notation\n\n Notes:\n   - For encoding:\n       - Use -- to separate your argument if it's a negative number.\n       - For floats: You can pass in NaN, Inf, -0, -Inf etc as the argument\n                     along with a decimal (2.3, -4.1e5) or hexadecimal float (0x2.4p3)\n   - For decoding:\n       - Use hexadecimal (0x) binary (0b), or N'h (verilog) notation as input.\n         Input must have one of these prefixes.\n       - You can use _,- or space as a digit to improve readability for the pattern to be decoded\n       - With -lN parameter, you can decode multiple lanes of data.\n       - If you use verilog input format, then we will infer the number of lanes unless you provide it.\n```\n\nVIM users: You can use the http://github.com/LeventErkok/crackNum/blob/master/crackNum.vim file to\nuse CrackNum directly from VIM. Simply locate your cursor on the text to crack, and use the\ncommand `:CrackNum options`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleventerkok%2Fcracknum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleventerkok%2Fcracknum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleventerkok%2Fcracknum/lists"}