Difference between revisions of "LlSHA256String/ja"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 4: Line 4:
|func_footnote
|func_footnote
|func_desc
|func_desc
|return_text=of 64 hex characters that is the {{Wikipedia|SHA-2|SHA-256}} security hash of {{LSLP|src}}.
|return_text={{LSLP|src}} の {{Wikipedia|SHA-2|SHA-256}} セキュリティハッシュである 64 文字の 16進数文字列。
|spec=LSL strings are stored in the UTF-8 format.
|spec=LSL 文字列は UTF-8 形式で保存されます。
|caveats=There's no way to input a zero-byte value into this function, nor any byte value from 128-255, therefore it's currently broken for many purposes (like HMAC-SHA1). The reason is because LSL strings cannot have a unicode null character (U+0000) in them, and LSL has no escape code for the null character (many programming languages use \0 but LSL does not have this feature). llEscapeURL("%00") yields an empty string. As well, inside this function, each character with a Unicode integer value over U+0127 / 007F are dealt with in UTF-8 fashion: in the hex values, 0xC2 is prepended to the byte value (hence 0x0080-0x00FF become 0xC280-0xC2FF inside the llSHA256String() routine).
|caveats=この関数には、ゼロバイト値や128-255のバイト値を入力する方法がないため、現時点では多くの目的(HMAC-SHA1など)で使用できません。 その理由は、LSL文字列には Unicode ヌル文字(U+0000)を含めることができず、LSLにはヌル文字のエスケープコードがないためです(多くのプログラミング言語は \0 を使用しますが、LSLにはこの機能がありません)。 llEscapeURL("%00") は空の文字列を生成します。また、この関数内では、Unicode の整数値が U+0127 / 007F を超える各文字に対して UTF-8 方式で処理されます。 16進数の値では、バイト値に 0xC2 が前置されます(したがって、llSHA256String() ルーチン内では、0x0080-0x00FF 0xC280-0xC2FF になります)。
|constants
|constants
|examples=
|examples=

Revision as of 15:11, 22 November 2023

要約

関数: string llSHA256String( string src );

src"Wikipedia logo"SHA-256 セキュリティハッシュである 64 文字の 16進数文字列。を string で返します。

• string src

仕様

LSL 文字列は UTF-8 形式で保存されます。

警告

この関数には、ゼロバイト値や128-255のバイト値を入力する方法がないため、現時点では多くの目的(HMAC-SHA1など)で使用できません。 その理由は、LSL文字列には Unicode ヌル文字(U+0000)を含めることができず、LSLにはヌル文字のエスケープコードがないためです(多くのプログラミング言語は \0 を使用しますが、LSLにはこの機能がありません)。 llEscapeURL("%00") は空の文字列を生成します。また、この関数内では、Unicode の整数値が U+0127 / 007F を超える各文字に対して UTF-8 方式で処理されます。 16進数の値では、バイト値に 0xC2 が前置されます(したがって、llSHA256String() ルーチン内では、0x0080-0x00FF は 0xC280-0xC2FF になります)。

All Issues ~ Search JIRA for related Bugs

サンプル

llSay(0, llSHA256String("Hello, Avatar!")); // returns 3a9f9d2e4360319a62139d19bd425c16fb8439b832d74d5221ca75b54c35b4f2

Linux Example

$ echo -n 'Hello, Avatar!' | openssl sha256
3a9f9d2e4360319a62139d19bd425c16fb8439b832d74d5221ca75b54c35b4f2

関連項目

関数

•  llMD5String/ja
•  llSHA1String/ja

記事

•  SHA-2/ja

特記事項

Prior to this, the only way to get the SHA-256 hash was to use the LSL SHA-256 port: SHA-2

Search JIRA for related Issues

Signature

function string llSHA256String( string src );
この翻訳は 原文 と比べて古いですか?間違いがありますか?読みにくいですか?みんなで 修正 していきましょう! (手順はこちら)
この項目はあなたにとって参考にならない項目ですか?もしかしたらLSL Wikiの関連した項目が参考になるかもしれません。