Hom ntaub ntawv twg yog Hash?
Hom ntaub ntawv twg yog Hash?

Video: Hom ntaub ntawv twg yog Hash?

Video: Hom ntaub ntawv twg yog Hash?
Video: Leng Yang - Yog Vim Dab Tsi (Official Full Song | Nkauj Tawm Tshiab) 2020/05/24 2024, Kaum ib hlis
Anonim

Hashes yog ib ntu ntawm cov khoom (128 khoom, 160 khoom, 256 khoom, thiab lwm yam, nyob ntawm qhov algorithm). Koj kem yuav tsum yog binary-typed, tsis yog ntawv / cim-typed, yog MySQL tso cai rau nws (SQL Server hom ntaub ntawv yog binary(n) lossis varbinary(n)).

Piv txwv li, cov ntaub ntawv hash yog dab tsi?

Hash . A hash yog ib txoj haujlwm uas hloov ib qho nqi mus rau lwm tus. Hashing cov ntaub ntawv yog ib qho kev xyaum hauv computer science thiab siv rau ntau lub hom phiaj sib txawv. Piv txwv muaj xws li cryptography, compression, checksum tiam, thiab cov ntaub ntawv indexing. Lub rooj yuav yog ib qho array, database, lossis lwm yam cov ntaub ntawv qauv.

Tom qab, lo lus nug yog, dab tsi yog hashing nrog piv txwv? A hash function yog ib qho haujlwm uas thaum muab tus yuam sij, tsim qhov chaw nyob hauv lub rooj. Cov piv txwv ntawm a hash muaj nuj nqi yog phau ntawv hu xov tooj. Qhov system no siv cov tsiaj ntawv thiab cov lej sib xyaw ua ke los npaj cov ntaub ntawv los ntawm cov ncauj lus. A hash muaj nuj nqi uas rov ua ib qho tshwj xeeb hash tus naj npawb hu ua universal hash muaj nuj nqi.

Hauv qhov no, dab tsi yog hashing thiab hom hashing hauv DBMS?

Hauv DBMS , hashing yog txheej txheem los tshawb nrhiav qhov chaw ntawm cov ntaub ntawv xav tau ntawm lub disk yam tsis siv cov qauv ntsuas. Ob hom kev hashing txoj kev yog 1) static hashing 2) dynamic hashing . Nyob rau hauv static hashing , qhov tshwm sim cov ntaub ntawv thoob qhov chaw nyob yuav nyob twj ywm tib yam.

Dab tsi yog datatype rau lo lus zais hauv MySQL?

  • MD5 - Nws tuaj yeem siv char(32) lossis BINARY(16).
  • SHA-1 - Nws tuaj yeem siv cov ntaub ntawv hom char(40) lossis BINARY(20).

Pom zoo: