import * as utils from '../../utils.js';
export class DerivationNonce {
    salt;
    iterations;
    static fromString(nonce) {
        const recovered = JSON.parse(nonce);
        return new DerivationNonce(recovered.salt, recovered.iterations);
    }
    constructor(salt, iterations) {
        this.salt = salt;
        this.iterations = iterations;
    }
    toString() {
        return JSON.stringify({ salt: this.salt, iterations: this.iterations });
    }
    static fromRandom() {
        return new DerivationNonce(utils.hex.bufToHex(crypto.getRandomValues(new Uint8Array(32))), Math.random() * 1000);
    }
}
//# sourceMappingURL=interfaces.js.map