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'); // сразу base64async 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
} last_call (уже не глобальную), результат присваивает переменной имя которой ей передали в параметрах и exit code работает как обычно.#!/bin/bash
last_call=never
function f {
local -n res=$1
printf -v last_call '%(%x %X)T'
res=$(($res * 2))
}
result=1
echo "Before: $last_call $result"
f result
echo "Return code: $?"
echo "After: $last_call $result"
sleep 1
f result
echo "Return code: $?"
echo "After: $last_call $result"Before: never 1
Return code: 0
After: 06/16/2020 02:48:23 PM 2
Return code: 0
After: 06/16/2020 02:48:24 PM 4