Jump to content

Search the Community

Showing results for tags 'Looking for the best solution'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


WWW


Interests

Found 1 result

  1. My current idea involves iterating through the array and recalculating the hash based on the previous hash and appending the next element as I go. #include <Array.au3> #include <Crypt.au3> Dim $arr[1][3][2]=[[["All","Your"],["Base","Are"],["Belong","To Us"]]] ;Declare an Array for Testing $bin = _HashArray($arr) ConsoleWrite($bin & @CRLF) Func _HashArray($arr) Dim $enc Global $arrDims[1][2]=[["ElementIdx","ElementCount"]] ;Create an Array to Track Dimensions and Elements For $x = 1 to UBound($arr,0) ReDim $arrDims[$x+1][2] $arrDims[$x][0]=0 $arrDims[$x][1]=UBound($arr,$x) Next Do ;Loop Through Array Elements $var = "$arr" For $x = 1 to UBound($arrDims)-1 $var &= "[" & $arrDims[$x][0] & "]" Next $enc = _Crypt_HashData($enc & Execute($var),$CALG_MD5) ;Update Hash $arrDims[UBound($arrDims)-1][0] += 1 ;Increment Last Dimension Element For $y = UBound($arrDims)-2 To 1 Step -1 ;Increment Dimension Element If $arrDims[$y+1][0] = $arrDims[$y+1][1] Then $arrDims[$y+1][0]=0 $arrDims[$y][0]+=1 EndIf Next Until $arrDims[1][0]=$arrDims[1][1] Return $enc EndFunc Sorry the code is confusing. I went off on a tangent to handle multidimensional arrays dynamically. Does anyone have a recommendation or practice on how to hash an array? edit: added some comments to the example code
×
×
  • Create New...