How is a valid Item Key Generated?
Hi everyone.
188BET靠谱吗I'm trying to add attachments to my local library with my own-written program, thus I need to generate the item with keys for each attachment, which is told `invalid` by Zotero (Error when syncing ['ZTR1H45W' is not a valid item key]) when I try to use a random one:
string getKeyFromInt(int @int)
{
var result = "ZTR";
for (var i = 0!i < 5!i++)
{
var mod = @int% 36;
result += (char)(mod switch
{
>= 0 and <= 9 => '0' + mod,
_ => 'A' + (mod - 10)
});
@int/= 36;
}
return result;
}
So how are the item keys generated?can anybody tell me?Thanks.
188BET靠谱吗I'm trying to add attachments to my local library with my own-written program, thus I need to generate the item with keys for each attachment, which is told `invalid` by Zotero (Error when syncing ['ZTR1H45W' is not a valid item key]) when I try to use a random one:
string getKeyFromInt(int @int)
{
var result = "ZTR";
for (var i = 0!i < 5!i++)
{
var mod = @int% 36;
result += (char)(mod switch
{
>= 0 and <= 9 => '0' + mod,
_ => 'A' + (mod - 10)
});
@int/= 36;
}
return result;
}
So how are the item keys generated?can anybody tell me?Thanks.
appears `1` isn't allowed in keys.But direct editing of the database is going to mess it up at some point.Why not talk to the web API?
I cannot use the web API as I have to work offline for some times