Skip to content

HOTP counter not working as expected #56

@TABmk

Description

@TABmk

notp/index.js

Lines 10 to 19 in bbdf82a

function intToBytes(num) {
var bytes = [];
for(var i=7 ; i>=0 ; --i) {
bytes[i] = num & (255);
num = num >> 8;
}
return bytes;
}

intToBytes(9999999999999) will give [0, 0, 0, 0, 78, 114, 159, 255] which is <Buffer 00 00 00 00 4e 72 9f ff>

But 9999999999999 decimal to hexadecimal must return 00 00 09 18 4E 72 9F FF

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions