Buchempfehlung
MySQL kurz & gut
MySQL kurz & gut
Das preiswerte Taschen- buch stellt MySQL-rele- vante Inhalte systematisch und knapp dar, sodass es sich optimal zum Nach- schlagen beim Pro- grammieren eignet. [Mehr Infos...]
FreeBASIC-Chat
Es sind Benutzer im FreeBASIC-Chat online.
(Stand:  )
FreeBASIC bei Twitter
Twitter FreeBASIC-Nachrichten jetzt auch über Twitter erhalten. Follow us!

fb:porticula NoPaste

Info
Info / Hilfe
Liste
Übersicht / Liste
Neu
Datei hochladen
Suche
Quellcode suchen
Download
Dateidownload

dofda1.bi

Uploader:Mitgliedcsde_rats
Datum/Zeit:26.11.2007 23:28:06

/'
    DOFDA1
    data or file digest algorithm 1
    
    
    (c) 2007 Marian Beermann
             aka csde_rats
            
    
'/


#Pragma msbitfields=0

#Include "file.bi"
#Include "string.bi"

Const BlockLen As Integer         = 512
Const HashLen As Integer          = BlockLen
Const EmptyCharNum As UByte       = 255
Const EmptyChar As String         = Chr(EmptyCharNum)
Const ThisDOFDA1Version As Byte   = &h11

Const TRUE                        = 0
Const FALSE                       = Not TRUE

Const PI As Double                = Atn(1.0) * 4


Type Boolean As Byte

Type dofda1_block
    num As ULongInt
    dat(0 To BlockLen) As UByte
    sHash As String * HashLen
End Type

Type dofda1_desc
    DOFDA_VER As Byte
    DOFDA_BLOCKS As ULongInt
End Type

Type dofda1_context
    Desc As dofda1_desc
    iProceedBlocks As ULongInt
    iBlockNum As ULongInt
    ubRawBlocks(0 To 1) As dofda1_block
    sHash As String * HashLen
End Type


Declare Function dofda1_version _
                 Lib "dofda1" Alias "dofda1_version" _
                 () _
                 As String
Declare Function dofda1_compatiblever _
                  Lib "dofda1" Alias "dofda1__compatiblever" _
                  (dd As dofda1_desc) _
                  As Boolean
Declare Function dofda1_createnewobject _
                 Lib "dofda1" Alias "dofda1_createnewobject" _
                 () _
                 As dofda1_desc
Declare Function dofda1_createnewblock _
                 Lib "dofda1" Alias "dofda1_createnewblock" _
                 (iNum As Integer) _
                 As dofda1_block

Declare Function dofda1_hashblock _
                 Lib "dofda1" Alias "dofda1_hashblock" _
                 (cContext As dofda1_context, _
                  iBlockNumber As ULongInt) _
                 As dofda1_context

Declare Function dofda1_io_getblock _
                 Lib "dofda1" Alias "dofda1_io_getblock" _
                 (FileNum As UByte, _
                  Offset As ULongInt) _
                 As dofda1_block
Declare Function dofda1_io_writeblock _
                 Lib "dofda1" Alias "dofda1_io_writeblock" _
                 (FileNum As UByte, _
                  Offset As ULongInt, _
                  bBlock As dofda1_block) _
                 As Boolean