refactor: remove useless "encodeInt" function

This commit is contained in:
Adhiraj Singh
2022-04-12 19:22:16 +05:30
parent 2c87bfae2c
commit 7fe4e58a11
2 changed files with 8 additions and 15 deletions

View File

@@ -75,17 +75,9 @@ export const encodeWAMessage = (message: proto.IMessage) => (
)
)
export const generateRegistrationId = () => (
Uint16Array.from(randomBytes(2))[0]
)
export const encodeInt = (e: number, t: number) => {
for(var r = t, a = new Uint8Array(e), i = e - 1; i >= 0; i--) {
a[i] = 255 & r
r >>>= 8
}
return a
export const generateRegistrationId = () => {
const buff = randomBytes(4)
return buff.readUInt32BE()
}
export const encodeBigEndian = (e: number, t = 4) => {