Update bytes.sub doc.

This commit is contained in:
Sander Spies 2020-06-11 17:49:48 +02:00
parent 1c5ea4b3f2
commit 9eabec28dc

View File

@ -55,8 +55,8 @@ val sub : nat -> nat -> bytes -> bytes
let sub : (nat, nat, bytes) => bytes let sub : (nat, nat, bytes) => bytes
</SyntaxTitle> </SyntaxTitle>
Extract the bytes between `pos1` and `pos2`. **Positions are zero indexed and Extract bytes from `start` to `length`. For example if you gave the
inclusive**. For example if you gave the input "ff7a7aff" to the following: input "ff7a7aff" to the following function:
<Syntax syntax="pascaligo"> <Syntax syntax="pascaligo">
@ -86,7 +86,7 @@ let slice_op = (s: bytes): bytes => Bytes.sub(1n, 2n, s);
</Syntax> </Syntax>
It would return "7a7a" rather than "ff7a" or "ff" or "7a". It would return "7a7a".
<SyntaxTitle syntax="pascaligo"> <SyntaxTitle syntax="pascaligo">
function pack : 'a -> bytes function pack : 'a -> bytes