Skip to content

encodedKey indexing out of sync in docs/CaskSecret.md #72

@KalleOlaviNiemitalo

Description

@KalleOlaviNiemitalo

In https://github.com/microsoft/cask/blob/main/docs/CaskSecret.md#url-safe-base64-encoded-rendering-example-for-256-bit-key-no-optional-data, the indexing of encodedKey goes out of sync after <12-bits-reserved> "AA":

cask/docs/CaskSecret.md

Lines 84 to 91 in 6f4c272

|encodedKey[52..56]|'TEST'| Provider fixed signature.
|encodedKey[56..58] | 'AA' | Reserved encoded zero characters.
|encodedKey[59]|'A'...'_'| Time-of-allocation year, 'A' (2025) to '_' (2088)|
|encodedKey[60|'A'...'L'| Time-of-allocation month, 'A' (January) to 'L' (December)|
|encodedKey[61]|'A'...'Z'\|'a'..'e'| Time-of-allocation day, 'A' (0) to 'e' (31)|
|encodedKey[62]|'A'...'X'| Time-of-allocation hour, 'A' (hour 0 or midnight) to 'X' (hour 23).
|encodedKey[63]|'A'...'7'| Time-of-allocation minute, 'A' (0) to '7' (59).
|encodedKey[64]|'A'...'7'| Time-of-allocation second, 'A' (0) to '7' (59).

It shows the time-of-allocation second at encodedKey[64], but that should instead be at encodedKey[63] so that the size of the whole thing is 64 characters and it evenly translates to 64/4*3 = 48 bytes.

Also, there is a closing bracket missing, and the 'a'..'e' range should use ... rather than .. because it's meant to include 'e'.

The table should end like this:

String Range Text Value Description
encodedKey[52..56] 'TEST' Provider fixed signature.
encodedKey[56..58] 'AA' Reserved encoded zero characters.
encodedKey[58] 'A'...'_' Time-of-allocation year, 'A' (2025) to '_' (2088)
encodedKey[59] 'A'...'L' Time-of-allocation month, 'A' (January) to 'L' (December)
encodedKey[60] 'A'...'Z'|'a'...'e' Time-of-allocation day, 'A' (0) to 'e' (31)
encodedKey[61] 'A'...'X' Time-of-allocation hour, 'A' (hour 0 or midnight) to 'X' (hour 23).
encodedKey[62] 'A'...'7' Time-of-allocation minute, 'A' (0) to '7' (59).
encodedKey[63] 'A'...'7' Time-of-allocation second, 'A' (0) to '7' (59).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions