Skip to content

Commit

Permalink
ex 3abcd 4 fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian M Hamlin committed Mar 18, 2021
1 parent f113ad5 commit 0e99ff6
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions spec/cBITS_provisional_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,35 +146,43 @@ Expanded Result from compact BITS
</pre>


**Example 3a** convert uint64 to dst uint32 to src uint256
**Example 3a** convert 64 bits hex to uint256, then to cBITS
Given: 0xFACE00FF00000000

0x000000000000000000000000000000000000000000000000FACE000000000000
0x000000000000000000000000000000000000000000000000FACE000000000000

0x0900FACE


**Example 3b** convert 16 bytes to dst uint32, to src uint256
**Example 3b** convert 16 bytes to uint256, back to cBITS
Given: 0xFACE00FF000000000000000000000000

0x00000000000000000000000000000000FACE0000000000000000000000000000

0x1100FACE

**Example 3c** convert 24 bytes to dst uint32, to src uint256

**Example 3c** convert 24 bytes to uint256, back to cBITS
Given: 0xFACE00FF0000000000000000000000000000000000000000

0x0000000000000000FACE00000000000000000000000000000000000000000000

0x1900FACE


**Example 3d** convert uint256 to dst uint32, to src uint256
**Example 3d** convert 32 bytes to uint32, back to cBITS
Given: 0xFACE00FF00000000000000000000000000000000000000000000000000000000

0xFACE000000000000000000000000000000000000000000000000000000000000

0x2100FACE


-----------------------------------------------------------------------------

**Example 4** convert out-of-range dst uint32 to src uint256
**Example 4** convert out-of-range cBITS to uint256
Given: 0x2A84FFFF

0x0000000000000000000000000000000000000000000000000000000000000000

note: out-of-range inputs return a full-length zero

0 comments on commit 0e99ff6

Please sign in to comment.