source/packing.js
function unpackEncryptedContent(encryptedContent) {
    const [content, iv, salt, auth, roundsRaw, methodRaw] = encryptedContent.split("$");
    // iocane was originally part of Buttercup's core package and used defaults from that originally.
    // There will be 4 components for pre 0.15.0 archives, and 5 in newer archives. The 5th component
    // is the pbkdf2 round count, which is optional:
    const rounds = roundsRaw ? parseInt(roundsRaw, 10) : PBKDF2_ROUND_DEFAULT;
    // Originally only "cbc" was supported, but GCM was added in version 1
    const method = methodRaw || "cbc";
    return {
        content,
        iv,
        salt,
        auth,
        rounds,
        method
    };
}
function unpackEncryptedContent(encryptedContent) {
    const [content, iv, salt, auth, roundsRaw, methodRaw] = encryptedContent.split("$");
    // iocane was originally part of Buttercup's core package and used defaults from that originally.
    // There will be 4 components for pre 0.15.0 archives, and 5 in newer archives. The 5th component
    // is the pbkdf2 round count, which is optional:
    const rounds = roundsRaw ? parseInt(roundsRaw, 10) : PBKDF2_ROUND_DEFAULT;
    // Originally only "cbc" was supported, but GCM was added in version 1
    const method = methodRaw || "cbc";
    return {
        content,
        iv,
        salt,
        auth,
        rounds,
        method
    };
}
function unpackEncryptedContent ( encryptedContent ) { const [ content , iv , salt , auth , roundsRaw , methodRaw ] = encryptedContent . split ( "$" ) ; // iocane was originally part of Buttercup's core package and used defaults from that originally. // There will be 4 components for pre 0.15.0 archives, and 5 in newer archives. The 5th component // is the pbkdf2 round count, which is optional: const rounds = roundsRaw ? parseInt ( roundsRaw , 10 ) : PBKDF2_ROUND_DEFAULT ; // Originally only "cbc" was supported, but GCM was added in version 1 const method = methodRaw || "cbc" ; return { content , iv , salt , auth , rounds , method } ; }
Unpack encrypted content components from an encrypted string
@param {String} encryptedContent The encrypted string
@returns {EncryptedComponents} The extracted components
@throws {Error} Throws if the number of components is incorrect
Unpack encrypted content components from an encrypted string