JPS63136223A - Hash circuit - Google Patents

Hash circuit

Info

Publication number
JPS63136223A
JPS63136223A JP61283862A JP28386286A JPS63136223A JP S63136223 A JPS63136223 A JP S63136223A JP 61283862 A JP61283862 A JP 61283862A JP 28386286 A JP28386286 A JP 28386286A JP S63136223 A JPS63136223 A JP S63136223A
Authority
JP
Japan
Prior art keywords
hash
register
bits
value
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP61283862A
Other languages
Japanese (ja)
Other versions
JPH0638264B2 (en
Inventor
Toshio Nakamura
敏夫 中村
Haruo Hayamizu
速水 治夫
Hideaki Takeda
武田 英昭
Tadashi Kitamura
正 北村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP61283862A priority Critical patent/JPH0638264B2/en
Publication of JPS63136223A publication Critical patent/JPS63136223A/en
Publication of JPH0638264B2 publication Critical patent/JPH0638264B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PURPOSE:To shorten the processing time and to simplify the constitution of a has circuit by outputting the intermediate hash value having the satisfactory random properties to the value of the input partial data and integrating the intermediate hash values stored in a table and corresponding to each partial data. CONSTITUTION:The contents of tables 130, 140 and 150 holding the intermediate hash values are read out by setting the value of input data to an address register 90. The intermediate hash value having the satisfactory random properties to all values of the input partial data is calculated and stored previously into each of said tables. The input is divided into high-order bits and low-order M/2 bits with the length of an output register 100 set at N bits. The high-order M/2 bits of the register 90 are used as the address of the table 130. Then the contents of the table 130 and the low-order M/2 bits of the register 90 are used as addresses to read out the tables 140 and 150. The hash values of each table are integrated by an integrating circuit 110 and the result of this integration is set at the register 100 for acquisition of the hash value.

Description

【発明の詳細な説明】 [産業上の利用分野] 本発明は、情報処理装置によるデータ管理システム等に
おいて用いられるハツシュ回路に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a hash circuit used in a data management system using an information processing device.

[従来の技術] 従来、ハツシュ回路のハツシュ関数については、種々の
ものが提案されており、除算法、乗算法、基本変換法、
代数符号化法などがあり、さらに、統合法として、重ね
合わせ法、折り返し法などがある。
[Prior Art] Conventionally, various hash functions for hash circuits have been proposed, including division methods, multiplication methods, basic conversion methods,
There are algebraic encoding methods, and furthermore, there are integration methods such as the superposition method and folding method.

除算法は、データの内部コードを2進数値と見なし、M
(整数・・・実際にはハツシュ表のサイズ)で割った剰
余をハツシュアドレスとする方法である。
The division method considers the internal code of the data as a binary value, and M
This method uses the remainder after dividing by an integer (actually the size of the hash table) as the hash address.

乗算法は、データをそれ自身、あるいはある定数と乗じ
、その結果のビット列の中央付近からハツシュ表サイズ
に従って所要のビット数だけを抽出する方法である。
The multiplication method is a method in which data is multiplied by itself or by a certain constant, and only the required number of bits are extracted from around the center of the resulting bit string according to the hash table size.

基本変換法は、データをp進数の数字列と見なし、それ
をq進数に変換した数字列から必要なビット数だけ取り
出す方法である(変換の演算は除算の繰り返しとなる)
The basic conversion method is to consider the data as a p-adic number string, convert it to a q-adic number, and extract the necessary number of bits from the number string (the conversion operation is a repetition of division).
.

代数符号化法は、考え方は除算法と類似しており、整数
で割る代わりに多項式表現での剰余計算を行うものであ
る。
The algebraic encoding method is similar in concept to the division method, and instead of dividing by an integer, remainder calculation is performed using a polynomial expression.

重ね合わせ法は、データをある単位で区分し、各区分に
ついて加算、排他的論理和(EXOR)などを行うもの
であり、折り返し法は上記の各区分を折り畳むように演
算を行うものである。
The superposition method divides data into certain units and performs addition, exclusive OR (EXOR), etc. for each division, while the folding method performs calculations to fold each of the above divisions.

なお、ハツシュ関数を解説した公知文献としては、例え
ば、「電子通信学会誌J  (Vol、63゜Nol、
pp、20−26.1980)の弓場敏嗣著“ハツシン
グによる見出し探索の技法[n]”及び「情報処理J 
 (VOl、21.NO,9゜pp、980−991.
1980)の西原清−著“ハツシングの技法と応用“な
どが挙げられる。
In addition, as a known document explaining the hash function, for example, "Journal of the Institute of Electronics and Communication Engineers J (Vol. 63° No.
pp. 20-26.1980) by Toshitsugu Yumiba, “Hashing-based heading search technique [n]” and “Information Processing J.
(VOl, 21.NO, 9°pp, 980-991.
Examples include ``Hashing Techniques and Applications'' by Kiyoshi Nishihara (1980).

[発明が解決しようとする問題点] ここで、上記除算法、乗算法、基本変換法、代数符号化
法、を各演算に対応する回路で実現する場合、回路が複
雑となり、ハードウェア規模が大きくなること、またハ
ツシュ値を得るまでの処理時間が大きいという問題点が
あった。
[Problems to be Solved by the Invention] If the above-mentioned division method, multiplication method, basic conversion method, and algebraic encoding method are implemented using circuits corresponding to each operation, the circuit becomes complicated and the hardware scale increases. There are problems in that the size of the hash value increases and the processing time required to obtain the hash value is long.

ハツシュ値を得るまでの処理時間を短縮できるハツシュ
回路を提供することにある。
An object of the present invention is to provide a hash circuit which can shorten processing time until obtaining a hash value.

[問題点を解決するための手段と作用コ本発明は、入力
するデータは、固定の長さで幾つかの切片に区分され(
該切片を部分データと呼ぶ)、予め、部分データの全て
の(入力)値に対してランダム性の良いハツシュ値(中
間ハツシュ値)を計算し、それを格納するテーブルを作
成しておき、データの入力時、入力する部分データの値
に対してランダム性の良い中間ハツシュ値を出力し、さ
らに、各部分データ(切片)に対応する中間ハツシュ値
について統合を行うことを、データが終わるまで繰り返
して、ハツシュ値を得ることに特徴がある。
[Means and effects for solving the problem] In the present invention, input data is divided into several sections with fixed lengths (
This intercept is called partial data). In advance, calculate a hash value with good randomness (intermediate hash value) for all (input) values of the partial data, create a table to store it, and then When inputting , it outputs intermediate hash values with good randomness for the input partial data values, and then integrates the intermediate hash values corresponding to each partial data (intercept), which is repeated until the data is finished. The feature is that the hash value is obtained.

[実施例] 第1図は本発明の第1の実施例を示す図であって、デー
タを1つのみの切片に区分した例である。
[Example] FIG. 1 is a diagram showing a first example of the present invention, and is an example in which data is divided into only one section.

120はRAMあるいはROM上に作成されたハツシュ
値を保持するテーブル、9oはテーブル120をアドレ
スするアドレスレジスタ、100はテーブル120から
読み出した内容を設定するレジスタである。
120 is a table that holds hash values created on the RAM or ROM, 9o is an address register that addresses the table 120, and 100 is a register that sets the contents read from the table 120.

ここで、予め、入力するデータの全ての値に対してラン
ダム性の良い変換値を計算し、その変換値(ハツシュ値
)を格納するテーブルを作成しておくものとする。具体
的な変換値の例としては、乗算法における入力するデー
タの値と定数との乗算結果を格納することがあるが、こ
れに限られるものでは無く、テーブルとしてランダム性
の良い変換値をを出力するものであれば、いずれの方法
でもよい。
Here, it is assumed that converted values with good randomness are calculated for all values of input data in advance, and a table is created in which the converted values (hash values) are stored. A specific example of a converted value is storing the multiplication result of the input data value and a constant in the multiplication method, but it is not limited to this, and it is possible to store converted values with good randomness as a table. Any method may be used as long as it outputs the output.

ここで、アドレスレジスタ90の長さはM(任意の整数
)ビット、出力レジスタ100の長さはN(任意の整数
)ビットとする。
Here, the length of the address register 90 is M (arbitrary integer) bits, and the length of the output register 100 is assumed to be N (arbitrary integer) bits.

アドレスレジスタ90に入力データの値を設定すること
により、テーブル120の内容を読み出し、出力レジス
タ100に設定し、ハツシュ値を得るものである。
By setting the value of input data in the address register 90, the contents of the table 120 are read out and set in the output register 100 to obtain a hash value.

第2図は本発明の第2の実施例を示す図であって、11
0は加算(ADD)あるいは排他的論理和(EXOR)
による統合回路、130,140゜150は中間ハツシ
ュ値を保持するテーブルである。
FIG. 2 is a diagram showing a second embodiment of the present invention, 11
0 is addition (ADD) or exclusive OR (EXOR)
130, 140, 150 is a table that holds intermediate hash values.

アドレスレジスタ90に入力データの値を設定すること
により、中間ハツシュ値を保持するテーブル130,1
40,150の内容を読み出す。
By setting the value of input data in the address register 90, a table 130, 1 that holds intermediate hash values is set.
Read the contents of 40,150.

ここで、テーブル130,140,150は、予め、入
力する部分データの全ての値に対してランダム性の良い
中間ハツシュ値を計算し、それを格納しておくものとす
る。テーブルとしてはランダム性の良い中間ハツシュ値
を出力するものであれば、いずれの方法でもよい。
Here, it is assumed that the tables 130, 140, and 150 calculate intermediate hash values with good randomness for all values of input partial data in advance and store them. Any method may be used as the table as long as it outputs intermediate hash values with good randomness.

ここで、入力するデータの長さはMビットで、M/2ビ
ット固定の長さの切片(部分データ)に区分し、データ
を保持するアドレスレジスタ90は、上位M/2ビット
、下位M/2ビットの2つに区分し、テーブルは3つの
場合で説明する。また、出力レジスタ100の長さはN
ビットとする。
Here, the input data length is M bits, and is divided into segments (partial data) with a fixed length of M/2 bits, and the address register 90 that holds the data is divided into upper M/2 bits, lower M/2 bits, and It is divided into two parts of 2 bits, and the table will be explained using three cases. Also, the length of the output register 100 is N
Bit.

アドレスレジスタ90の」二位M/2ビ・ソトをテーブ
ル130のアドレスとして、テーブル130の内容を、
また、アドレスレジスタ90の下位M/2ビットをアド
レスとして、テーブル140及び150を読み出す。次
に、テーブルi3o、i40.150の出力内容(各中
間ハツシュ値)について統合回路110により統合し、
その結果を出力レジスタ100に設定し、ハツシュ値を
得るものである。
The contents of the table 130 are set as the address of the table 130 using the second position M/2 BiSoto of the address register 90.
Further, the tables 140 and 150 are read using the lower M/2 bits of the address register 90 as an address. Next, the output contents of tables i3o and i40.150 (each intermediate hash value) are integrated by the integration circuit 110,
The result is set in the output register 100 to obtain a hash value.

第3図は本発明の第3の実施例を示す図であって、入力
するデータの長さが長い場合において、第2図における
手法をもとに、各部分データに対応する統合を多段に行
うものである。入力するデータは、固定の長さで複数の
切片に区分するものとする。
FIG. 3 is a diagram showing a third embodiment of the present invention, in which when the length of input data is long, integration corresponding to each partial data is performed in multiple stages based on the method shown in FIG. It is something to do. The input data shall be divided into multiple sections with fixed lengths.

あるいは第2図の構成からなるテーブルハツシュ器、1
60は各部分データ(切片)に対するテーブルハツシュ
器の出力内容について統合を行う統合回路である。統合
回路160の中で、30はハツシュ値あるいは中間ハツ
シュ値を保持するハツシュレジスタ、50はテーブルハ
ツシュ器の出力内容とハツシュレジスタの出力内容とを
特定の演算(加算あるいは排他的論理和など)を施して
重ね合わせてハツシュレジスタへ書き戻す重ね合わせ回
路、60はハツシュレジスタの内容を全て指定されたビ
ット数だけローティトするローティト回路、70はロー
ティト回路60のローティトするビット数を指示する信
号の入力端子である。
Alternatively, a table hashing machine having the configuration shown in Fig. 2, 1
Reference numeral 60 denotes an integration circuit that integrates the output contents of the table hash unit for each partial data (intercept). In the integrated circuit 160, 30 is a hash register that holds a hash value or an intermediate hash value, and 50 is a hash register that performs a specific operation (addition or exclusive OR) on the output contents of the table hash unit and the output contents of the hash register. 60 is a rotation circuit that rotates all the contents of the hash register by a specified number of bits, and 70 indicates the number of bits to be rotated by the rotation circuit 60. This is the input terminal for the signal to be output.

第3図の動作は次の通りである。ここで、データ長はM
l(任意の整数)バイト、部分データの長さはm(任意
の整数)バイトで説明する。
The operation of FIG. 3 is as follows. Here, the data length is M
The length of the partial data is explained as l (any integer) bytes, and the length of the partial data is m (any integer) bytes.

テーブルハツシュ器40は、部分データ(長さmバイト
)の値をアドレスとして(第1図あるいは第2図のアド
レスレジスタ90に格納)、テーブルの内容を読み出し
た中間ハツシュ値、または、中間ハツシュ値に簡単な演
算を施したものを出力する。
The table hash unit 40 uses the value of the partial data (length m bytes) as an address (stored in the address register 90 in FIG. 1 or 2), and reads out the contents of the table as an intermediate hash value or an intermediate hash Outputs a value after performing a simple operation.

次に、統合回路160は、各部分データ(切片)に対す
るテーブルハツシュ器の出力内容について順次統合を行
っていくものであり、第2図の統合回路110にローテ
ィト回路を付加したものである。統合回路160の動作
を説明する。
Next, the integration circuit 160 sequentially integrates the output contents of the table hash unit for each partial data (intercept), and is the integration circuit 110 shown in FIG. 2 with a rotation circuit added thereto. The operation of integrated circuit 160 will be explained.

ローティト回路60は、ローティトするビット数を指示
する信号(端子70から入力する)に従い、ハツシュレ
ジスタの全てのビットをそのビット数分ローティトする
。(なお、ローティトするビット数は、入力するデータ
の形式(2進データ形式、文字ストリングデータ形式な
ど)、最大値(あるいは最大長)、ハツシュ表サイズな
どをもとに決められるものである。) 次に、重ね合わせ回路50は、テーブルハツシュ器40
の出力内容と、ローティト回路60の出力内容との特定
の演算(加算あるいは排他的論理和(EXOR)などの
演算)を施して、ハツシュレジスタ30に書き戻す処理
を行う。(なお、ハツシュレジスタ30は1データのハ
ツシュが終われば、その都度クリアされる。) 以上述べた処理を部分データの全てについて(データが
終わるまで)繰り返してハツシュ値を得、ハツシュアド
レスの出力端子80に出力する。
The rotation circuit 60 rotates all the bits of the hash register by the number of bits in accordance with a signal (input from the terminal 70) indicating the number of bits to be rotated. (The number of bits to rotate is determined based on the input data format (binary data format, character string data format, etc.), maximum value (or maximum length), hash table size, etc.) Next, the superposition circuit 50
A specific operation (such as an addition or an exclusive OR (EXOR) operation) is performed on the output contents of the rotate circuit 60 and the output contents of the rotate circuit 60, and the result is written back to the hash register 30. (The hash register 30 is cleared each time one data hash has been completed.) The above-mentioned process is repeated for all the partial data (until the data is completed) to obtain the hash value, and the hash address is Output to the output terminal 80.

ここで、統合回路としては、加算あるいは、排他的論理
和(EXOR)などの簡単な演算を用いてもよいし、重
ね合わせあるいは折り返しなどの方法を回路化すること
で、容易に構成できる。
Here, the integrated circuit may use a simple operation such as addition or exclusive OR (EXOR), or it can be easily configured by using a method such as superposition or folding.

なお、統合する手段は、これに限られるものでは無く、
統合を行えればいずれの方法でもよい。
Note that the means of integration is not limited to this,
Any method is fine as long as it can be integrated.

また、入力するデータの長さ、並びにハツシュ値(ハツ
シュアドレスの長さ)は任意の長さの場合においても容
易に構成できる。さらに、データ分割方法(個数、切片
長の固定/可変、等)並びにテーブルの個数が任意の場
合においても、統合の方法を変えることで容易に構成で
きる。
Furthermore, the length of the input data and the hash value (length of the hash address) can be easily configured to any length. Furthermore, even if the data division method (fixed/variable number, section length, etc.) and the number of tables are arbitrary, the structure can be easily configured by changing the integration method.

また、入力データを固定長の〜切片に区分し、その部分
データのバイト幅でストリーム状に入力する場合も容易
に構成できる。
Furthermore, it is also possible to easily configure a case where input data is divided into segments of fixed length and inputted in a stream format with the byte width of the partial data.

[発明の効果] 以上説明したように、本発明によれば、1つのテーブル
あるいは複数のテーブルと簡単な統合手段を用いたハツ
シュ回路により、 (1)  入力するデータの値に対してランダム性の良
い変換値を出力し、それをハツシュ値とする、あるいは
、 (2)  入力するデータを固定の長さで複数の切片に
区分し、その部分データの全ての値に対してランダム性
の良い変換値(中間ハツシュ値)を出力し、さらに、各
部分データ(切片)に対するテーブルの出力内容につい
て統合を行なうことを、部分データの全てについて(デ
ータが終わるまで)繰り返して、ハツシュ値を得る ようにしたため、回路構成が簡単となり、ハードウェア
規模を小さくでき、かつ、ハツシュ値を得るまでの処理
時間を短縮できるという利点がある。
[Effects of the Invention] As explained above, according to the present invention, by using a hash circuit using one table or a plurality of tables and a simple integration means, (1) randomness can be reduced for input data values; Output a good conversion value and use it as a hash value, or (2) Divide the input data into multiple intercepts with a fixed length and perform a conversion with good randomness for all values of the partial data. Output the value (intermediate hash value), and then integrate the output contents of the table for each partial data (intercept), which is repeated for all partial data (until the data is finished) to obtain the hash value. Therefore, there are advantages in that the circuit configuration is simplified, the hardware scale can be reduced, and the processing time required to obtain a hash value can be shortened.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の第1の実施例の構成図、第2図は本発
明の第2の実施例の構成図、第3図は本発明の第3の実
施例の構成図である。 20・・・入力レジスタ、30・・・ハツシュレジスタ
、40・・・テーブルハツシュ器、50・・・重ね合わ
せ回路、60・・・ローティト回路、80・・・ハツシ
ュアドレスの出力端子、90・・・アドレスレジスタ、
100・・・出力レジスタ、110.160・・・統合
回路、120,130,140.150・・・テーブル
。 出願人代理人 弁理士 鈴 江 武 彦第1 図 第2 図 第3 図
FIG. 1 is a block diagram of a first embodiment of the present invention, FIG. 2 is a block diagram of a second embodiment of the present invention, and FIG. 3 is a block diagram of a third embodiment of the present invention. 20... Input register, 30... Hash register, 40... Table hash unit, 50... Superposition circuit, 60... Rotate circuit, 80... Hash address output terminal, 90...address register,
100...Output register, 110.160...Integrated circuit, 120,130,140.150...Table. Applicant's agent Patent attorney Takehiko Suzue Figure 1 Figure 2 Figure 3

Claims (1)

【特許請求の範囲】[Claims] 1つ以上の切片に区分されたデータを入力し、該切片の
値に対応する中間ハッシュ値を保持するテーブルと、各
切片に対応するテーブルの読み出し内容の統合手段とを
具備することを特徴とするハッシュ回路。
It is characterized by comprising a table into which data divided into one or more sections is input and holds an intermediate hash value corresponding to the value of the section, and means for integrating read contents of the table corresponding to each section. hash circuit.
JP61283862A 1986-11-28 1986-11-28 Hash circuit Expired - Lifetime JPH0638264B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61283862A JPH0638264B2 (en) 1986-11-28 1986-11-28 Hash circuit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61283862A JPH0638264B2 (en) 1986-11-28 1986-11-28 Hash circuit

Publications (2)

Publication Number Publication Date
JPS63136223A true JPS63136223A (en) 1988-06-08
JPH0638264B2 JPH0638264B2 (en) 1994-05-18

Family

ID=17671133

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61283862A Expired - Lifetime JPH0638264B2 (en) 1986-11-28 1986-11-28 Hash circuit

Country Status (1)

Country Link
JP (1) JPH0638264B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04230575A (en) * 1990-10-30 1992-08-19 Internatl Business Mach Corp <Ibm> Method and apparatus for performing key hashing in data processor

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63115734A (en) * 1986-11-04 1988-05-20 東京瓦斯株式会社 Lining material for duct

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59125437A (en) * 1982-12-30 1984-07-19 インタ−ナシヨナル ビジネス マシ−ンズ コ−ポレ−シヨン Hash circuit

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS59125437A (en) * 1982-12-30 1984-07-19 インタ−ナシヨナル ビジネス マシ−ンズ コ−ポレ−シヨン Hash circuit

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04230575A (en) * 1990-10-30 1992-08-19 Internatl Business Mach Corp <Ibm> Method and apparatus for performing key hashing in data processor

Also Published As

Publication number Publication date
JPH0638264B2 (en) 1994-05-18

Similar Documents

Publication Publication Date Title
JP5118234B2 (en) ROM-based finite-length impulse response filter used in mobile phones
US6121901A (en) Data compression and decompression system with immediate dictionary updating interleaved with string search
CN109218301B (en) Method and device for mapping frame header defined by software between multiple protocols
KR20160106570A (en) Block mining methods and apparatus
DE102020110578A1 (en) SELF-TESTING COMPRESSION
JPS63136223A (en) Hash circuit
CN106385260B (en) A kind of FPGA realization system of the LZ lossless compression algorithm based on low delay
US7256715B1 (en) Data compression using dummy codes
JP3394781B2 (en) Method and apparatus for generating a transform
TW508926B (en) Method and system for efficient routing table compression and fast routing lookups
CN114117149A (en) Sensitive word filtering method and device and storage medium
US6628211B1 (en) Prefix table implemented data compression method and apparatus
Guo Null boundary controllability for a fourth order parabolic equation
JPS62154138A (en) Hash circuit
JP3038233B2 (en) Data compression and decompression device
JP5072558B2 (en) Data processing device
JP3038234B2 (en) Dictionary search method for data compression equipment
JPS60204032A (en) Pseudo random number generating circuit
CN113626364A (en) High-speed serial interface and conversion circuit for same
JP3838525B2 (en) Symbol string probability calculation device
JPS6141184A (en) Data processor
Acri Implementation of a data compressor based on the AEP Theorem
JPH05307361A (en) Data diffusion device and data diffusion method
Wang et al. Efficient IP address lookup with a counting Bloom filter in Trie-based algorithms
JP2001211083A (en) Crc output processing device