Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6925059
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:44:29+00:00 2026-05-27T10:44:29+00:00

I am using xcode and this is my sha512 method: -(NSString*) sha512:(NSString*)input { const

  • 0

I am using xcode and this is my sha512 method:

-(NSString*) sha512:(NSString*)input
{
    const char *cstr = [input cStringUsingEncoding:NSUTF8StringEncoding];
    NSData *data = [NSData dataWithBytes:cstr length:input.length];

    uint8_t digest[CC_SHA512_DIGEST_LENGTH];

    CC_SHA512(data.bytes, data.length, digest);

    NSMutableString* output = [NSMutableString stringWithCapacity:CC_SHA512_DIGEST_LENGTH * 2];

    for (int i = 0; i < CC_SHA512_DIGEST_LENGTH; i++) {
        [output appendFormat:@"%02x", digest[i]];
    }

    return output;
}

When I try to pass the input “test”, it returns:
“ee26b0dd4af7e749aa1a8ee3c10ae9923f618980772e473f8819a5d4940e0db27ac185f8a0e1d5f84f88bc887fd67b143732c304cc5fa9ad8e6f57f50028a8ff”
which matches other sha512 hash tools (including my Java program and “http://hash.online-convert.com/sha512-generator&#8221;).

However, when I input non-ascii char like “é”, it returns something different than all my other sha512 tools.
For input “é”, my method returns:
“60313f8521d3016916d876f7ad11cf42a30dfd4ff9bc557f1e2f90e0d37c56b76ab5e42c8a16db20c18086b0d769c08542429c262cc21ee4fba02bfc689a4797”
when other tools (again including my Java program and “http://hash.online-convert.com/sha512-generator&#8221;) return “9e2ad28633f24451bd4f3c1cb20586a21a44c3aeedbdc01b9cc8fa72917ea7bd689c82b8bf1fef89b911cf8cc46fa2c1ccc10087b2094fd4d3350ecd88526a2c”.

Did I miss anything? Any ideas about this?
Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:44:30+00:00Added an answer on May 27, 2026 at 10:44 am

    Create your NSData object like this:

    NSData *data = [input dataUsingEncoding:NSUTF8StringEncoding];
    

    Just double checked and it works correctly like that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using XCode 3.2, What I'm trying to do is have the user input data
I am using this Xcode template for core data. On the delegate, I have
I am using XCode 4.0.2 for a iOS4 project. I have this class method
Using the Pre Release Xcode 3.2.3 I get this as a Startup Project (source:
I'm using Xcode version 3.2.2 but the tutorial at this site was made for
I would like to know my iPhone places using Xcode like this app .I
So, get this: Ever since I've started using XCode to handle my software development
I am using Xcode 4.2.1 and I have this problem running an existing application
I'm tasked with creating an application using XCode for OSX. This application needs to
Using Xcode. In this code (func is declared in interface), tells subj error, standing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.