[SparForte][Banner]
[Top Main Menu] Intro | Tutorials | Reference | Packages | Examples | Contributors   [Back Page]      [Next Page]  

GNAT.CRC32 Package

The gnat.crc32 package is the standard CRC package included with GCC Ada (Gnat).

GCC Ada Equivalent: GNAT.CRC32

     i := gnat.crc32.get_value( c )
     gnat.crc32.initialize( c )
     gnat.crc32.update( c, s )
 
Help Command: Contents of the gnat.crc32 package

The gnat.crc32 package includes one type: gnat.crc32.crc32.

=> gnat.crc32.initialize( c )
=> (Assuming c is a new gnat.crc32.crc32 variable)
=> gnat.crc32.update( c, "Deign, Sovereign Mistress! to accept a lay,")
=> gnat.crc32.update( c, "No Laureate offering of elaborate art;")
=> crc := gnat.crc32.get_value( c )
=> (Assuming crc is a new integer variable)
=> ? crc
 3245118365
 
Example: Using the gnat.crc32 package

gnat.crc32.initialize( c )

 

Initialize CRC value by assigning the standard Init value (16#FFFF_FFFF).

Example

gnat.crc32.initialize( c );

Parameters

Param Mode Type Default Description
c out gnat.crc32.gnatcrc32 required the CRC32 counter

Exceptions

-

See Also

numerics.md5

Compare With

Ada: GNAT.CRC32.Initialize
PHP: crc32

gnat.crc32.update( c, s )

 

Evolve CRC by including the contribution from Character'Pos (Value) for each character in the string.

Example

gnat.crc32.update( c, "fred" );

Parameters

Param Mode Type Default Description
c in out gnat.crc32.gnatcrc32 required the CRC32 counter
s in universal_string required the string type to evaluate

Exceptions

-

See Also

numerics.md5

Compare With

Ada: GNAT.CRC32.Update
PHP: crc32

i := gnat.crc32.get_value( c )

 

Computes the CRC32 value by performing an XOR with the standard XorOut value (16#FFFF_FFFF). Note that this does not change the value of c, so it may be used to retrieve intermediate values of the CRC32 value during a sequence of update calls.

Example

counter := gnat.crc32.get_value( c );

Parameters

Param Mode Type Default Description
c in gnat.crc32.gnatcrc32 required the CRC32 counter
i result integer required the partial result

Exceptions

-

See Also

numerics.md5

Compare With

Ada: GNAT.CRC32.Get_Value
PHP: crc32

 
[Right Submenu]

 Summary

 arrays

 btree_io

 calendar

 cgi

 chains

 command_line

 db/ postgresql

 dbm

 directory_operations

 doubly_linked...

 dynamic_hash_...

 enums

 exceptions

 files

 gnat.cgi

 gnat.crc32

 hash_io

 lock_files

 memcache

 memcache.highread

 mysql

 mysqlm

 numerics

 os

 pen

 pen (OpenGL)

 records

 sound

 source_info

 stats

 strings

 System

 teams

 templates

 text_io

 units

[Back to Top] Back To Top [Small Forte Symbol]