Hi Chuck,
I have trawled through your website and not found what I need in one place? If I have missed it, I apologise in advance
Do you have a page online that gives what data types and sizes Cobra supports? I want to play with some digital signature / encryption algorithms which means I need to know what size data types are for shifting, rotating etc.
Best Regards,
MarkL
Forums
What data types / sizes supported by Cobra?
7 posts
• Page 1 of 1
Re: What data types / sizes supported by Cobra?
Hi,
I'm not Chuck but until he replies maybe I can help.
Here is a list with all Cobra primitive types, and their supported operations (in addition to the usual operators):
http://cobra-language.com/trac/cobra/wiki/PrimitiveTypeMembers
You have versions of int where you can explicitly specifiy the number of bits (int8, int16, int32, int64), and of course their unsigned counterparts. If you just say int or uint, you get 32 bits
These are the equivalences between C# and Cobra integers:
C# Cobra
'byte': 'uint8',
'sbyte': 'int8',
'short': 'int16',
'ushort': 'uint16',
'int': 'int',
'long': 'int64',
'ulong': 'uint64',
If you need integers of arbitrary precision you can use any of the classes that are available for .NET. For example: http://www.carljohansen.co.uk/bigint/. For instructions on how to access C# code from Cobra, see this post.
I'm not Chuck but until he replies maybe I can help.
Here is a list with all Cobra primitive types, and their supported operations (in addition to the usual operators):
http://cobra-language.com/trac/cobra/wiki/PrimitiveTypeMembers
You have versions of int where you can explicitly specifiy the number of bits (int8, int16, int32, int64), and of course their unsigned counterparts. If you just say int or uint, you get 32 bits
These are the equivalences between C# and Cobra integers:
C# Cobra
'byte': 'uint8',
'sbyte': 'int8',
'short': 'int16',
'ushort': 'uint16',
'int': 'int',
'long': 'int64',
'ulong': 'uint64',
If you need integers of arbitrary precision you can use any of the classes that are available for .NET. For example: http://www.carljohansen.co.uk/bigint/. For instructions on how to access C# code from Cobra, see this post.
- jonathandavid
- Posts: 159
Re: What data types / sizes supported by Cobra?
Hi jonathandavid,
That was just what I needed.
Thanks!
MarkL
That was just what I needed.
Thanks!
MarkL
- mlivingstone
- Posts: 3
Re: What data types / sizes supported by Cobra?
I created a new wiki page on this topic called TypesOverview and I fleshed out StreamType. That should help quite a bit.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
Re: What data types / sizes supported by Cobra?
Chuck wrote:I created a new wiki page on this topic called TypesOverview and I fleshed out StreamType. That should help quite a bit.
Thanks Chuck, this is a valuable addition. Don't you think something a little bit more explicit could be said in the "types overview" page about dynamic vars?
- jonathandavid
- Posts: 159
Re: What data types / sizes supported by Cobra?
Well we could even break out a separate wiki page, right? If you need something right now, you can poke through the release notes going backwards and you'll find a section on the dynamic type. Also, check out the test cases.
- Charles
- Posts: 2515
- Location: Los Angeles, CA
7 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 17 guests