fix, chore, feat: refactor of settings app, fix of Google Auth migration parse, added rename button(testing), added sort feature, added timeout to screen turning off, formated codes with space between 6-digits codes
Co-authored-by: DemiarUA <demiar97@gmail.com> https://github.com/Lisoveliy/totpfit/pull/1
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
export function decodeVarint(buffer, offset) {
|
||||
let res = 0;
|
||||
let shift = 0;
|
||||
let byte = 0;
|
||||
let res = 0;
|
||||
let shift = 0;
|
||||
let byte = 0;
|
||||
|
||||
do {
|
||||
if (offset >= buffer.length) {
|
||||
throw new RangeError("Index out of bound decoding varint");
|
||||
}
|
||||
do {
|
||||
if (offset >= buffer.length) {
|
||||
throw new RangeError("Index out of bound decoding varint");
|
||||
}
|
||||
|
||||
byte = buffer[offset++];
|
||||
byte = buffer[offset++];
|
||||
|
||||
const multiplier = 2 ** shift;
|
||||
const thisByteValue = (byte & 0x7f) * multiplier;
|
||||
shift += 7;
|
||||
res = res + thisByteValue;
|
||||
} while (byte >= 0x80);
|
||||
const multiplier = 2 ** shift;
|
||||
const thisByteValue = (byte & 0x7f) * multiplier;
|
||||
shift += 7;
|
||||
res = res + thisByteValue;
|
||||
} while (byte >= 0x80);
|
||||
|
||||
return {
|
||||
value: res,
|
||||
length: shift / 7
|
||||
};
|
||||
return {
|
||||
value: res,
|
||||
length: shift / 7,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user