INNER CODE UNIT · TypeScript

getCurrentBrowserFingerPrint

Rajesh-Royal/Broprint.js · src/index.ts:31

export async function getCurrentBrowserFingerPrint(options: BroprintOptions = {}): Promise<string> {
    const { useAudio = true, useCanvas = true, seed = 0 } = options;

    if (!useAudio && !useCanvas) {
        throw new Error(
            'getCurrentBrowserFingerPrint: at least one of useAudio or useCanvas must be true'
        );
    }

    if (useAudio) {
        try {
            const audioResult = await getAudioFingerprint();
            const combined = useCanvas
                ? window.btoa(audioResult) + getCanvasFingerprint()
                : window.btoa(audioResult);
            return cyrb53(combined, seed).toString();
        } catch (audioError) {
            if (!useCanvas) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…