OneDrive / onedrive-api-docs

Official documentation for the OneDrive API
MIT License
458 stars 232 forks source link

How to Generate quickXorHash key ...? #1736

Open vikram9491 opened 1 year ago

vikram9491 commented 1 year ago

Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you.

Submission Guidelines:

  • Questions and bugs are welcome, please let us know what's on your mind.
  • If you are reporting an issue around any of the documents or articles, please provide clear reference(s) to the specific file(s) or URL('s).
  • Remember to include sufficient details and context.
  • If you have multiple issues, please submit them as separate issues so we can track resolution.

(DELETE THIS PARAGRAPH AFTER READING)

byte[] hashArray = { 48, 49, 86, 50, 75, 85, 89, 82, 70, 81 ,72, 53, 72 ,69, 86, 52, 82, 85, 84 ,82, 66, 73, 87, 87 ,79 ,76 ,84, 73, 50 ,83, 78, 83, 81, 80 }; //byte[] hashArray = {150, 131 ,160, 235, 250, 243, 185, 8 ,191, 159, 10, 168, 143, 95, 123 ,116, 187, 168, 19, 195}; Console.WriteLine("hasharray::::"); Console.WriteLine(hashArray.Length); quickXorHash.HashCore(hashArray,0,34); var hashValue = quickXorHash.HashFinal();

    Console.WriteLine("OneDrive QuickXorHash Value:");
    foreach (var b in hashValue)
    {
        Console.Write(b + " ");
    }
   // Convert the hash value to Base64 string
    string base64Hash = Convert.ToBase64String(hashValue);
    Console.WriteLine("\nBase64 Hash Value: " + base64Hash);      

i referred microsoft doc also but not getting proper key as same as onedrive api is giving https://learn.microsoft.com/en-us/dotnet/api/system.security.cryptography.hashalgorithm.hashfinal?view=net-7.0

Category

For the above list, an empty checkbox is . A checked checkbox is x with no space between the brackets. Use the PREVIEW tab at the top right to preview the rendering before submitting your issue.

If you are planning to share a new feature request (enhancement / suggestion), please use the OneDrive Developer Platform UserVoice at http://aka.ms/od-dev-uservoice, or the SharePoint Developer Platform UserVoice at http://aka.ms/sp-dev-uservoice. If you have a question about Azure Active Directory, outside of issues with the documentation provided in the OneDrive Developer Center, please ask it here: https://stackoverflow.com/questions/tagged/azure-active-directory

(DELETE THIS PARAGRAPH AFTER READING)

Expected or Desired Behavior

If you are reporting a bug, please describe the expected behavior.

(DELETE THIS PARAGRAPH AFTER READING)

Observed Behavior

If you are reporting a bug, please describe the observed behavior.

Please also provide the following response headers corresponding to your request(s):

  • Date (in UTC, please)
  • request-id
  • SPRequestGuid (for requests made to OneDrive for Business)

(DELETE THIS PARAGRAPH AFTER READING)

Steps to Reproduce

If you are reporting a bug, please describe the steps to reproduce the bug in sufficient detail for another person to be able to reproduce it.

(DELETE THIS PARAGRAPH AFTER READING)

Thank you.

ificator commented 11 months ago

You can use this sample implementation to generate the hash: https://learn.microsoft.com/en-us/onedrive/developer/code-snippets/quickxorhash?view=odsp-graph-online#sample-code-c-sharp