-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
119 additions
and
113 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,47 @@ | ||
~~~~ cbor-diag | ||
18( / COSE Single Signer Data Object / | ||
18( / COSE Sign 1 / | ||
[ | ||
h'a3012604...392b6601', / Protected header / | ||
{ / Unprotected header / | ||
-22222: { / Proofs / | ||
1: [ / Inclusion proofs (2) / | ||
h'83040282...1f487bb1', / Inclusion proof 1 / | ||
h'83040382...1f487bb1', / Inclusion proof 2 / | ||
h'a3012604...392b6601', / Protected / | ||
{ / Unprotected / | ||
-22222: { / Proofs / | ||
1: [ / Inclusion proofs (2) / | ||
h'83040282...1f487bb1', / Inclusion proof 1 / | ||
h'83040382...1f487bb1', / Inclusion proof 2 / | ||
] | ||
}, | ||
}, | ||
h'', / Detached payload / | ||
h'0a1e2031...5cb26f93' / Signature / | ||
h'', / Detached payload / | ||
h'a490381e...c166e580' / Signature / | ||
] | ||
) | ||
~~~~ | ||
|
||
~~~~ cbor-diag | ||
{ / Protected header / | ||
1: -7, / Cryptographic algorithm to use / | ||
4: h'68747470...6d706c65', / Key identifier / | ||
-11111: 1 / Verifiable data structure / | ||
{ / Protected / | ||
1: -7, / Cryptographic algorithm to use/ | ||
4: h'68747470...6d706c65', / Key identifier / | ||
-11111: 1 / Verifiable data structure / | ||
} | ||
~~~~ | ||
|
||
~~~~ cbor-diag | ||
[ / Inclusion proof 1 / | ||
4, / Tree size / | ||
2, / Leaf index / | ||
[ / Inclusion hashes (2) / | ||
h'a39655d4...d29a968a' / Intermediate hash 1 / | ||
h'57187dff...1f487bb1' / Intermediate hash 2 / | ||
[ / Inclusion proof 1 / | ||
4, / Tree size / | ||
2, / Leaf index / | ||
[ / Inclusion hashes (2) / | ||
h'a39655d4...d29a968a' / Intermediate hash 1 / | ||
h'57187dff...1f487bb1' / Intermediate hash 2 / | ||
] | ||
] | ||
~~~~ | ||
|
||
~~~~ cbor-diag | ||
[ / Inclusion proof 2 / | ||
4, / Tree size / | ||
3, / Leaf index / | ||
[ / Inclusion hashes (2) / | ||
h'e7f16481...aab81688' / Intermediate hash 1 / | ||
h'57187dff...1f487bb1' / Intermediate hash 2 / | ||
[ / Inclusion proof 2 / | ||
4, / Tree size / | ||
3, / Leaf index / | ||
[ / Inclusion hashes (2) / | ||
h'e7f16481...aab81688' / Intermediate hash 1 / | ||
h'57187dff...1f487bb1' / Intermediate hash 2 / | ||
] | ||
] | ||
~~~~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
|
||
import { maxLineLength, commentOffset } from './constants' | ||
|
||
|
||
export const addComment = (line: string, comment: string) => { | ||
let paddedComment = ' '.repeat(maxLineLength - commentOffset - line.length) + `/ ` + `${comment}` | ||
paddedComment = paddedComment + ' '.repeat(maxLineLength - line.length - paddedComment.length) + '/' | ||
let linePrexiSpaces = maxLineLength - commentOffset - line.length | ||
if (linePrexiSpaces < 0) { | ||
linePrexiSpaces = 0; | ||
} | ||
let paddedComment = ' '.repeat(linePrexiSpaces) + `/ ` + `${comment}` | ||
|
||
const lineSuffixSpaces = maxLineLength - line.length - paddedComment.length | ||
|
||
paddedComment = paddedComment + ' '.repeat(lineSuffixSpaces) + '/' | ||
return `${line}${paddedComment}` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export const maxLineLength = 76 | ||
export const commentOffset = 40 | ||
export const maxLineLength = 68 | ||
export const commentOffset = 32 | ||
export const maxBstrTruncateLength = 32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
~~~~ cbor-diag | ||
18( / COSE Single Signer Data Object / | ||
18( / COSE Sign 1 / | ||
[ | ||
h'a3012604...392b6601', / Protected header / | ||
{ / Unprotected header / | ||
-22222: { / Proofs / | ||
2: [ / Consistency proofs (1) / | ||
h'83040682...2e73a8ab', / Consistency proof 1 / | ||
h'a3012604...392b6601', / Protected / | ||
{ / Unprotected / | ||
-22222: { / Proofs / | ||
2: [ / Consistency proofs (1) / | ||
h'83040682...2e73a8ab', / Consistency proof 1 / | ||
] | ||
}, | ||
}, | ||
h'430b6fd7...f74c7fc4', / Payload / | ||
h'f5095fb2...692bc9fd' / Signature / | ||
h'430b6fd7...f74c7fc4', / Payload / | ||
h'03c9eb00...6201c3ad' / Signature / | ||
] | ||
) | ||
~~~~ | ||
|
||
~~~~ cbor-diag | ||
{ / Protected header / | ||
1: -7, / Cryptographic algorithm to use / | ||
4: h'68747470...6d706c65', / Key identifier / | ||
-11111: 1 / Verifiable data structure / | ||
{ / Protected / | ||
1: -7, / Cryptographic algorithm to use/ | ||
4: h'68747470...6d706c65', / Key identifier / | ||
-11111: 1 / Verifiable data structure / | ||
} | ||
~~~~ | ||
|
||
~~~~ cbor-diag | ||
[ / Consistency proof 1 / | ||
4, / Tree size 1 / | ||
6, / Tree size 2 / | ||
[ / Consistency hashes (2) / | ||
h'0bdaaed3...32568964' / Intermediate hash 1 / | ||
h'75f177fd...2e73a8ab' / Intermediate hash 2 / | ||
[ / Consistency proof 1 / | ||
4, / Tree size 1 / | ||
6, / Tree size 2 / | ||
[ / Consistency hashes (2) / | ||
h'0bdaaed3...32568964' / Intermediate hash 1 / | ||
h'75f177fd...2e73a8ab' / Intermediate hash 2 / | ||
] | ||
] | ||
~~~~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
~~~~ cbor-diag | ||
18( / COSE Single Signer Data Object / | ||
18( / COSE Sign 1 / | ||
[ | ||
h'a3012604...392b6601', / Protected header / | ||
{ / Unprotected header / | ||
-22222: { / Proofs / | ||
1: [ / Inclusion proofs (1) / | ||
h'83040282...1f487bb1', / Inclusion proof 1 / | ||
h'a3012604...392b6601', / Protected / | ||
{ / Unprotected / | ||
-22222: { / Proofs / | ||
1: [ / Inclusion proofs (1) / | ||
h'83040282...1f487bb1', / Inclusion proof 1 / | ||
] | ||
}, | ||
}, | ||
h'', / Detached payload / | ||
h'b53e2c6a...cb3f43cb' / Signature / | ||
h'', / Detached payload / | ||
h'bcbbeeca...1535f71f' / Signature / | ||
] | ||
) | ||
~~~~ | ||
|
||
~~~~ cbor-diag | ||
{ / Protected header / | ||
1: -7, / Cryptographic algorithm to use / | ||
4: h'68747470...6d706c65', / Key identifier / | ||
-11111: 1 / Verifiable data structure / | ||
{ / Protected / | ||
1: -7, / Cryptographic algorithm to use/ | ||
4: h'68747470...6d706c65', / Key identifier / | ||
-11111: 1 / Verifiable data structure / | ||
} | ||
~~~~ | ||
|
||
~~~~ cbor-diag | ||
[ / Inclusion proof 1 / | ||
4, / Tree size / | ||
2, / Leaf index / | ||
[ / Inclusion hashes (2) / | ||
h'a39655d4...d29a968a' / Intermediate hash 1 / | ||
h'57187dff...1f487bb1' / Intermediate hash 2 / | ||
[ / Inclusion proof 1 / | ||
4, / Tree size / | ||
2, / Leaf index / | ||
[ / Inclusion hashes (2) / | ||
h'a39655d4...d29a968a' / Intermediate hash 1 / | ||
h'57187dff...1f487bb1' / Intermediate hash 2 / | ||
] | ||
] | ||
~~~~ |
Oops, something went wrong.