From 0e99ff62ca45b19a8240b5d4bd41859570b61a1a Mon Sep 17 00:00:00 2001 From: Brian M Hamlin Date: Thu, 18 Mar 2021 16:42:56 -0700 Subject: [PATCH] ex 3abcd 4 fmt --- spec/cBITS_provisional_spec.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/spec/cBITS_provisional_spec.md b/spec/cBITS_provisional_spec.md index 4776ef0..e34e5a8 100644 --- a/spec/cBITS_provisional_spec.md +++ b/spec/cBITS_provisional_spec.md @@ -146,35 +146,43 @@ Expanded Result from compact BITS -**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