@hello.nrfcloud.com/proto
Version: 
Documents the communication protocol between the hello.nrfcloud.com backend and the web application
14 lines (12 loc) • 385 B
text/typescript
import { generateCode } from './generateCode.js'
export const fingerprintGenerator = (productionRun: number): (() => string) => {
	const productionRunCodes: string[] = []
	return (): string => {
		let code = generateCode()
		while (productionRunCodes.includes(code)) {
			code = generateCode()
		}
		productionRunCodes.push(code)
		return `${productionRun.toString(16)}.${code}`
	}
}