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 4544040
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:36:56+00:00 2026-05-21T15:36:56+00:00

Currently I search a function in MySQL to do conversion between hex string to

  • 0

Currently I search a function in MySQL to do conversion between hex string to binary representation, example:

0000 -> 0000000000000000
00AA -> 0000000010101010
FFFF -> 1111111111111111

I have already tried

UNHEX('00AA')
CAST('00AA' AS BINARY)
CONVERT('00AA', BINARY)

but didn’t get the results I want.

  • 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-21T15:36:57+00:00Added an answer on May 21, 2026 at 3:36 pm

    Use CONV() function:

    CONV(string, 16, 2)
    

    To have length according to input:

    LPAD(CONV(string, 16, 2), LENGTH(string)*4, '0')
    

    As CONV() works with 64-bit precision, you can’t have more than 64 bits converted, so you can use this as well:

    LPAD(CONV(string, 16, 2), 64, '0')
    

    and you should check that LENGTH(string) <= 16 or you may get erroneous results.

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

Sidebar

Related Questions

I'm currently working on a Google Maps project and am implementing a search function.
Currently I have a table that I search upon 4 fields, FirstName, LastName, MiddleName,
We're currently using Lucene 2.1.0 for our site search and we've hit a difficult
I have a search form in an app I'm currently developing, and I would
I am working on a website that currently has a number of disparate search
What's your preferred method of providing a search facility on a website? Currently I
I'm currently developing a website which stores bookmarks in a MySQL database using PHP
I am building a search function on my website and I am having some
PROBLEM: importing data into ALREADY CREATED mySQL database I've done a lot of search
I'm still trying to implement a search function into my Android app. So far

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.