private static function hash($card) {
    /* We are encoding the password list just because we want to make
     * the file look nice, and to avoid bugs with special characters. */
    $card['list'] = base64_encode(json_encode($card['list']));
    $card['hash'] = hash(self::HASH_TYPE, $card['list']);
    $card['id']   = substr($card['hash'], 0, 12);

    return $card;
  }
private static function hash($card) {
    /* We are encoding the password list just because we want to make
     * the file look nice, and to avoid bugs with special characters. */
    $card['list'] = base64_encode(json_encode($card['list']));
    $card['hash'] = hash(self::HASH_TYPE, $card['list']);
    $card['id']   = substr($card['hash'], 0, 12);

    return $card;
  }
private static function hash ( $ card ) { /* We are encoding the password list just because we want to make
     * the file look nice, and to avoid bugs with special characters. */ $ card [ 'list' ] = base64_encode ( json_encode ( $ card [ 'list' ] ) ) ; $ card [ 'hash' ] = hash ( self :: HASH_TYPE , $ card [ 'list' ] ) ; $ card [ 'id' ] = substr ( $ card [ 'hash' ] , 0 , 12 ) ; return $ card ; }
Prepeare the password card for saving.

@param array $card
Array containing the card data to hash.

@return array
Array containing hashed card data. Ready for phpsecOtpcard::save().
Prepeare the password card for saving .