Why is not the MongoId 12-byte long but the 24-byte?
Asked Answered
G

1

5

According to the official document:

A BSON ObjectID is a 12-byte value consisting of a 4-byte timestamp (seconds since epoch), a 3-byte machine id, a 2-byte process id, and a 3-byte counter

But actually it's a 24-byte value like 4d7f4787ac6d604009000000

Why does this happen ?

Grecoroman answered 16/3, 2011 at 3:33 Comment(1)
To the people who downvoted this: why? There's nothing wrong with this question.Vanderhoek
V
8

That's a hexidecimal value. One hex digit = 4 bits. 24 hex digits = 96 bits = 12 bytes.

Vexed answered 16/3, 2011 at 3:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.