document.cookie = 'name=value';
document.cookie = 'name=value; path=/';
document.cookie = newCookie;
[...]
;path=path
(e.g., '/', '/mydir') If not specified, defaults to the current path of the current document location.
$ apt show linux-doc
[...]
Description: Linux kernel specific documentation for version 4.15.0
This package provides the various documents in the 4.15.0 kernel
Documentation/ subdirectory. These document kernel subsystems, APIs, device
drivers, and so on. See
/usr/share/doc/linux-doc/00-INDEX for a list of what is
contained in each file.
crypto.createHash('sha1').update(str).digest('latin1'); // raw_output
crypto.createHash('sha1').update(str).digest('base64'); // сразу base64
async function sha1(str) {
const buf = Uint8Array.from(unescape(encodeURIComponent(str)), c=>c.charCodeAt(0)).buffer;
const digest = await crypto.subtle.digest('SHA-1', buf);
const raw = String.fromCharCode.apply(null, new Uint8Array(digest));
return raw; // 20-символьная строка
// или
return btoa(raw); // base64
}