HashAlgorithm.TransformBlock メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > HashAlgorithm.TransformBlock メソッドの意味・解説 

HashAlgorithm.TransformBlock メソッド

入力バイト配列指定した領域ハッシュ値計算し結果ハッシュ値出力バイト配列指定した領域コピーします

名前空間: System.Security.Cryptography
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Function TransformBlock ( _
    inputBuffer As Byte(), _
    inputOffset As Integer, _
    inputCount As Integer, _
    outputBuffer As Byte(), _
    outputOffset As Integer _
) As Integer
Dim instance As HashAlgorithm
Dim inputBuffer As Byte()
Dim inputOffset As Integer
Dim inputCount As Integer
Dim outputBuffer As Byte()
Dim outputOffset As Integer
Dim returnValue As Integer

returnValue = instance.TransformBlock(inputBuffer, inputOffset, inputCount, outputBuffer,
 outputOffset)
public int TransformBlock (
    byte[] inputBuffer,
    int inputOffset,
    int inputCount,
    byte[] outputBuffer,
    int outputOffset
)
public:
virtual int TransformBlock (
    array<unsigned char>^ inputBuffer, 
    int inputOffset, 
    int inputCount, 
    array<unsigned char>^ outputBuffer, 
    int outputOffset
) sealed
public final int TransformBlock (
    byte[] inputBuffer, 
    int inputOffset, 
    int inputCount, 
    byte[] outputBuffer, 
    int outputOffset
)
public final function TransformBlock (
    inputBuffer : byte[], 
    inputOffset : int, 
    inputCount : int, 
    outputBuffer : byte[], 
    outputOffset : int
) : int

パラメータ

inputBuffer

ハッシュ コード計算する対象入力データ

inputOffset

入力バイト配列内のデータ使用開始位置を示すオフセット

inputCount

データとして使用する入力バイト配列内のバイト数。

outputBuffer

ハッシュ コード計算使用される入力配列一部コピー

outputOffset

データ書き込み開始位置を示す出力バイト配列内のオフセット

戻り値
書き込むバイト数。

解説解説

TransformFinalBlock メソッド呼び出す前にTransformBlock メソッド呼び出す必要があります。この 2 つメソッド呼び出した後で最後ハッシュ値取得する必要があります

TransformFinalBlock メソッド呼び出した後、最後ハッシュ値取得するには、Hash プロパティ含まれるバイト配列取得します

他の入力配列出力配列使用して TransformBlock メソッド呼び出すと、IOException が発生します

使用例使用例

次のコード例では、TransformFinalBlock メソッドTransformBlock メソッド使用して文字列ハッシュしています。

// Use TransformFinalBlock with TransformBlock to hash a string.
byte[] inArray = new ASCIIEncoding().GetBytes("abcdefghijklmnopqrstuvwxyz");
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
md5.TransformBlock(inArray, 0, 13, inArray, 0);
md5.TransformFinalBlock(inArray, 13, 13);
// Use TransformFinalBlock with TransformBlock to hash a string.
array<Byte>^inArray = (gcnew ASCIIEncoding)->GetBytes( L"abcdefghijklmnopqrstuvwxyz"
 );
MD5CryptoServiceProvider^ md5 = gcnew MD5CryptoServiceProvider;
md5->TransformBlock( inArray, 0, 13, inArray, 0 );
md5->TransformFinalBlock( inArray, 13, 13 );

// Use TransformFinalBlock with TransformBlock to hash a string.
ubyte inArray[] = (new ASCIIEncoding()).GetBytes(
    "abcdefghijklmnopqrstuvwxyz");
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
md5.TransformBlock(inArray, 0, 13, inArray, 0);
md5.TransformFinalBlock(inArray, 13, 13);
// Hash two strings together.
byte[] inArray1 = new ASCIIEncoding().GetBytes("message ");
byte[] inArray2 = new ASCIIEncoding().GetBytes("digest");
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
md5.TransformBlock(inArray1, 0, inArray1.Length, inArray1, 0);
md5.TransformFinalBlock(inArray2, 0, inArray2.Length);
// Hash two strings together.
array<Byte>^inArray1 = (gcnew ASCIIEncoding)->GetBytes( L"message "
 );
array<Byte>^inArray2 = (gcnew ASCIIEncoding)->GetBytes( L"digest"
 );
MD5CryptoServiceProvider^ md5 = gcnew MD5CryptoServiceProvider;
md5->TransformBlock( inArray1, 0, inArray1->Length, inArray1, 0 );
md5->TransformFinalBlock( inArray2, 0, inArray2->Length );

// Hash two strings together.
ubyte inArray1[] = (new ASCIIEncoding()).GetBytes("message
 ");
ubyte inArray2[] = (new ASCIIEncoding()).GetBytes("digest");
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
md5.TransformBlock(inArray1, 0, inArray1.get_Length(), inArray1, 0);
md5.TransformFinalBlock(inArray2, 0, inArray2.get_Length());
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
HashAlgorithm クラス
HashAlgorithm メンバ
System.Security.Cryptography 名前空間
その他の技術情報
暗号サービス


このページでは「.NET Framework クラス ライブラリ リファレンス」からHashAlgorithm.TransformBlock メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からHashAlgorithm.TransformBlock メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からHashAlgorithm.TransformBlock メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

HashAlgorithm.TransformBlock メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



HashAlgorithm.TransformBlock メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS