問題タブ [binarystream]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
1 に答える
1525 参照

python - curl リクエスト用にバイナリ文字列を 16 進数に変換する

次のような構造体パックがあります

>>> encode_number(1) b'\x00\x00\x00\x01'

>>> decode_number(b'\x00\x00\x00\x01') 1

curl を介して与えられるトランザクションは Hex のように与えられます。 curl http://localhost:26657/broadcast_tx_commit?tx=0x01

したがって、0x01 は 16 進数で 1 です。curl コマンドでバイナリ文字列を簡単に 16 進数に変換するにはどうすればよいですか? (Linux 端末が望ましい)