This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// parse a Link header | |
// | |
// Link:<https://example.org/.meta>; rel=meta | |
// | |
// var r = parseLinkHeader(xhr.getResponseHeader('Link'); | |
// r['meta'] outputs https://example.org/.meta | |
// | |
function parseLinkHeader(header) { | |
var linkexp = /<[^>]*>\s*(\s*;\s*[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g; | |
var paramexp = /[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
did:muport:QmPoZWgtvv8NQAkmfz6vBCrGQqb2nuBJgcrVLDb4Gqyz2e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:steel_crypt/steel_crypt.dart'; | |
import 'dart:convert'; | |
void main() async { | |
final passHash = PassCrypt('SHA-256/HMAC/PBKDF2'); | |
final ivsalt = CryptKey().genDart(16); | |
final derivationPassword = 'foobar'; | |
final derivedHash = passHash.hashPass(ivsalt, derivationPassword); | |
// prepare the key to be used by AesCrypt | |
final derivedBytes = base64Decode(derivedHash); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- MIT License --> | |
<html> | |
<head> | |
<script> | |
function generateKey(alg, scope) { | |
return new Promise(function(resolve) { | |
var genkey = crypto.subtle.generateKey(alg, true, scope) | |
genkey.then(function (pair) { | |
resolve(pair) | |
}) |
OlderNewer