Sha256: bcefd1264a977510cbba96ae5fa199fe37962842a830c99b7411192a97f8760e

Contents?: true

Size: 562 Bytes

Versions: 15

Compression:

Stored size: 562 Bytes

Contents

#include "insensitive_to_sensitive.h"
#include "ruby.h"
#include <string.h>
#include "salesforce_id_ext.h"
#include "repair_casing.h"

// rb_sId MUST be a string and of size 18
VALUE insensitive_to_sensitive(VALUE rb_sId)
{
  const int   new_id_size = SALESFORCE_ID_INSENSITIVE_STRING_LENGTH;
        char* id          = StringValueCStr(rb_sId);
        char  new_id[SALESFORCE_ID_INSENSITIVE_STRING_LENGTH] = {0};

  memcpy(new_id, id, new_id_size);
  repair_casing(new_id);
  memset(&new_id[15], '\0', sizeof(new_id[0]) * 4u);

  return rb_str_new2(new_id);
}

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
salesforce_id-1.4.6 ext/salesforce_id/insensitive_to_sensitive.c
salesforce_id-1.4.5 ext/salesforce_id/insensitive_to_sensitive.c
salesforce_id-1.4.4 ext/salesforce_id/insensitive_to_sensitive.c
salesforce_id-1.4.3 ext/salesforce_id/insensitive_to_sensitive.c
salesforce_id-1.4.2 ext/salesforce_id/insensitive_to_sensitive.c
salesforce_id-1.4.1 ext/salesforce_id/insensitive_to_sensitive.c
salesforce_id-1.4.0 ext/salesforce_id/insensitive_to_sensitive.c
salesforce_id-1.3.4 ext/salesforce_id/insensitive_to_sensitive.c
salesforce_id-1.3.3 ext/salesforce_id/insensitive_to_sensitive.c
salesforce_id-1.3.2 ext/salesforce_id/insensitive_to_sensitive.c
salesforce_id-1.3.1 ext/salesforce_id/insensitive_to_sensitive.c
salesforce_id-1.3.0 ext/salesforce_id/insensitive_to_sensitive.c
salesforce_id-1.2.0 ext/salesforce_id/insensitive_to_sensitive.c
salesforce_id-1.1.0 ext/salesforce_id/insensitive_to_sensitive.c
salesforce_id-1.0.0 ext/salesforce_id/insensitive_to_sensitive.c